.class public Lcom/melesta/payment/amazon/RequestBuilder;
.super Ljava/lang/Object;
.source "RequestBuilder.java"

# interfaces
.implements Lcom/melesta/payment/interfaces/IRequestBuilder;


# static fields
.field public static final NAME_TAG:Ljava/lang/String; = "name"

.field private static final SKU_TAG:Ljava/lang/String; = "billingCode"


# instance fields
.field private final request:Lcom/melesta/payment/amazon/Request;


# direct methods
.method public constructor <init>(Lcom/melesta/payment/amazon/PaymentSystem;)V
    .locals 1
    .parameter "system"

    .prologue
    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 14
    new-instance v0, Lcom/melesta/payment/amazon/Request;

    invoke-direct {v0, p1}, Lcom/melesta/payment/amazon/Request;-><init>(Lcom/melesta/payment/amazon/PaymentSystem;)V

    iput-object v0, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    .line 15
    return-void
.end method


# virtual methods
.method public createRequest()Lcom/melesta/payment/interfaces/IRequest;
    .locals 2

    .prologue
    .line 20
    new-instance v0, Lcom/melesta/payment/amazon/Request;

    iget-object v1, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v1}, Lcom/melesta/payment/amazon/Request;->getSystem()Lcom/melesta/payment/amazon/PaymentSystem;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/melesta/payment/amazon/Request;-><init>(Lcom/melesta/payment/amazon/PaymentSystem;)V

    .line 21
    .local v0, r:Lcom/melesta/payment/amazon/Request;
    iget-object v1, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v1}, Lcom/melesta/payment/amazon/Request;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/melesta/payment/amazon/Request;->setName(Ljava/lang/String;)Lcom/melesta/payment/amazon/Request;

    .line 22
    iget-object v1, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v1}, Lcom/melesta/payment/amazon/Request;->getSku()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/melesta/payment/amazon/Request;->setSku(Ljava/lang/String;)V

    .line 23
    iget-object v1, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v1}, Lcom/melesta/payment/amazon/Request;->getMultiplier()F

    move-result v1

    invoke-virtual {v0, v1}, Lcom/melesta/payment/amazon/Request;->setMultiplier(F)Lcom/melesta/payment/interfaces/IRequest;

    .line 25
    return-object v0
.end method

.method public get(Ljava/lang/String;)Ljava/lang/Object;
    .locals 1
    .parameter "param"

    .prologue
    .line 42
    const-string v0, "name"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 43
    iget-object v0, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v0}, Lcom/melesta/payment/amazon/Request;->getName()Ljava/lang/String;

    move-result-object v0

    .line 47
    :goto_0
    return-object v0

    .line 44
    :cond_0
    const-string v0, "billingCode"

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 45
    iget-object v0, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v0}, Lcom/melesta/payment/amazon/Request;->getSku()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 47
    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public set(Ljava/lang/String;Ljava/lang/Object;)Lcom/melesta/payment/interfaces/IRequestBuilder;
    .locals 2
    .parameter "param"
    .parameter "value"

    .prologue
    .line 30
    invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    .line 32
    .local v0, val:Ljava/lang/String;
    const-string v1, "name"

    invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 33
    iget-object v1, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v1, v0}, Lcom/melesta/payment/amazon/Request;->setName(Ljava/lang/String;)Lcom/melesta/payment/amazon/Request;

    .line 37
    :cond_0
    :goto_0
    return-object p0

    .line 34
    :cond_1
    const-string v1, "billingCode"

    invoke-virtual {p1, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 35
    iget-object v1, p0, Lcom/melesta/payment/amazon/RequestBuilder;->request:Lcom/melesta/payment/amazon/Request;

    invoke-virtual {v1, v0}, Lcom/melesta/payment/amazon/Request;->setSku(Ljava/lang/String;)V

    goto :goto_0
.end method
